package com.software.graduationproject.modules.sys.service;


import com.baomidou.mybatisplus.core.metadata.Page;

import com.software.graduationproject.modules.sys.entity.SysUserRole;
import com.software.graduationproject.modules.sys.mapper.SysUserRoleMapper;
import com.software.graduationproject.modules.sys.object.SysUserRoleVo;
import com.software.graduationproject.modules.sys.object.SysUserRoleCreateQo;
import com.software.graduationproject.modules.sys.object.SysUserRoleUpdateQo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * SysUserRoleService : 客户用户
 * ---------------------------------------------------------------------------------------------------------------------
 */
@Service
public class SysUserRoleService {

    @Autowired
    private SysUserRoleMapper sysUserRoleMapper;

//    public void createQo(SysUserRoleCreateQo qo){
//        SysUserRole sysUserRole = new SysUserRole();
//        Beans.copyPropertiesNotNull(sysUserRole, qo);
//        sysUserRoleMapper.create(sysUserRole);
//    }
//
//    public void updateQo(SysUserRoleUpdateQo qo){
//        SysUserRole sysUserRole = sysUserRoleMapper.select(qo.getId());
//        if (sysUserRole == null){
//            throw  new ServiceException("数据不存在");
//        }
//
//        Beans.copyPropertiesNotNull(sysUserRole, qo);
//        sysUserRoleMapper.update(sysUserRole);
//    }
//
//    public SysUserRoleVo selectVo(Long id) {
//        SysUserRoleVo sysUserRoleVo = new SysUserRoleVo();
//        SysUserRole sysUserRole = sysUserRoleMapper.select(id);
//        Beans.copyPropertiesNotNull(sysUserRoleVo, sysUserRole);
//        return sysUserRoleVo;
//    }

    public Page<SysUserRoleVo> selectPageVo(){
        return sysUserRoleMapper.selectPageVo();
    }

    public List<SysUserRoleVo> selectListVo(){
        return sysUserRoleMapper.selectListVo();
    }
}
